#!/usr/bin/env python
#-*-encoding:utf-8-*-
from django.conf.urls import patterns, include, url

#Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
import xadmin
xadmin.autodiscover()
# from xadmin.plugins import xversion
# xversion.registe_models()

import logging
logging.basicConfig(level = logging.DEBUG)

import sys
sys.path.append('../zmWsDebug')
from zmWsDebug.views import showApiList,showApiParams
print 'ws ok'

sys.path.append('../zmDataTuning')
from zmDataTuning.views import calculate_simlar_rssi,search_flow,show_employee_rssi_stat,show_employee_rssi_stat_by_mac,show_rssi_from_employee
print 'datatuning ok'
from views import *

from zmShowRawdata.views import myRawdataClass
print 'rawdata ok'
from zmAPMonitor.app.views import show_ap_status,show_ap_status_by_comp,show_ap_online_time,show_ap_status_by_comp_with_version,show_device_relegation
print 'apmonitor ok'
sys.path.append('../zmExport')
from zmExport.app.views import export_macs_from_mysql,export_hour_data_from_mysql

sys.path.append('../zmSchedulerTools')
#from zmSchedulerTools.app.views import show_jobs


urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'zmWebTools.views.home', name='home'),
    # url(r'^zmWebTools/', include('zmWebTools.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(xadmin.site.urls)),
    
    url(r'^static/(.*)$', 'django.views.static.serve', {'document_root':os.path.join(os.path.dirname(__file__),'../static').replace('\\','/')}),
    
    url(r'^js/(?P<path>.*)$', 'django.views.static.serve', {'document_root':os.path.join(os.path.dirname(__file__),'../static/js').replace('\\','/')}),
    url(r'^css/(?P<path>.*)$', 'django.views.static.serve', {'document_root':os.path.join(os.path.dirname(__file__),'../static/css').replace('\\','/')}),
    url(r'^fonts/(?P<path>.*)$', 'django.views.static.serve', {'document_root':os.path.join(os.path.dirname(__file__),'../static/fonts').replace('\\','/')}),
    url(r'^images/(?P<path>.*)$', 'django.views.static.serve', {'document_root':os.path.join(os.path.dirname(__file__),'../static/img').replace('\\','/')}),
    url(r'^download/(.*)$', 'django.views.static.serve', {'document_root':os.path.join(os.path.dirname(__file__),'../templates/download/').replace('\\','/') ,'show_indexes':True}),
    
    url(r'^js/(?P<path>.*)$', 'django.views.static.serve', {'document_root':os.path.join(os.path.dirname(__file__),'../static/TableTools/js').replace('\\','/')}),
    url(r'^css/(?P<path>.*)$', 'django.views.static.serve', {'document_root':os.path.join(os.path.dirname(__file__),'../static/TableTools/css').replace('\\','/')}),
   # url(r'^images/(?P<path>.*)$', 'django.views.static.serve', {'document_root':os.path.join(os.path.dirname(__file__),'../static/TableTools/images').replace('\\','/')}),
    url(r'^swf/(?P<path>.*)$', 'django.views.static.serve', {'document_root':os.path.join(os.path.dirname(__file__),'../static/TableTools/swf').replace('\\','/')}),
    
    #登陆
    (r'^accounts/login/$',  login),
    (r'^accounts/logout/$', logout), 
    
    #工具列表
    url(r'^$',show_tools),
    
    # 计划任务
    #url(r'^scheduler/jobs/$',show_jobs),
    
    
    #探测数据相关
    url(r'^rawdata/realtime/$',myRawdataClass.getMsgFromRawdata),
    url(r'^roledata/realtime/$',myRawdataClass.getMsgFromRoledata),
    url(r'^rawdata/history/$',myRawdataClass.showHistoryRaw),
    
    
    #ws api 调试
    url(r'^api_debug/$',showApiList),
    url(r'^api_debug/',showApiParams),
    url(r'^retail_api/$',showApiList),
    url(r'^retail_api/',showApiParams),
    url(r'^ms_debug/$',showApiList),
    url(r'^ms_debug/',showApiParams),
    
    
    #不同的rssi数据查询;数据调优
    url(r'^expect_rssi/',calculate_simlar_rssi),
    url(r'^search_flow/',search_flow),
    
    url(r'^employee/rssi/',show_employee_rssi_stat),
    url(r'^employee/mac_rssi/',show_employee_rssi_stat_by_mac),
    url(r'^rssi_from_employee',show_rssi_from_employee),
    
    #设备相关
    url(r'^ap/status/',show_ap_status),
    url(r'^comp_ap/status/',show_ap_status_by_comp),
    url(r'^ap/onlinetime/',show_ap_online_time),
    url(r'^comp_ap/status_version/',show_ap_status_by_comp_with_version),
    url(r'^ap/relegation/',show_device_relegation),
    
    
    #数据导出
    url(r'^export/macs/',export_macs_from_mysql),
    url(r'^export/datas/hour/',export_hour_data_from_mysql),
    
    

    #测试
    url(r'^testing/',show_testing),
)




